<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>UploadFile.mxml</title>
<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/>
</head>

<body><pre><span class="MXMLProcessing_Instruction">&lt;?xml version="1.0" encoding="utf-8"?&gt;</span>
<span class="MXMLComponent_Tag">&lt;s:Application</span><span class="MXMLDefault_Text"> xmlns:fx="</span><span class="MXMLString">http://ns.adobe.com/mxml/2009</span><span class="MXMLDefault_Text">" 
               xmlns:s="</span><span class="MXMLString">library://ns.adobe.com/flex/spark</span><span class="MXMLDefault_Text">" 
               xmlns:mx="</span><span class="MXMLString">library://ns.adobe.com/flex/mx</span><span class="MXMLDefault_Text">" minWidth="</span><span class="MXMLString">500</span><span class="MXMLDefault_Text">" minHeight="</span><span class="MXMLString">300</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">356</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">562</span><span class="MXMLDefault_Text">" creationComplete="</span><span class="ActionScriptDefault_Text">initizeApp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" viewSourceURL="</span><span class="MXMLString">srcview/index.html</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>
    <span class="MXMLComponent_Tag">&lt;s:layout&gt;</span>
        <span class="MXMLComponent_Tag">&lt;s:BasicLayout/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;/s:layout&gt;</span>
    <span class="MXMLSpecial_Tag">&lt;fx:Declarations&gt;</span>
        <span class="MXMLComment">&lt;!--</span><span class="MXMLComment"> 将非可视元素（例如服务、值对象）放在此处 </span><span class="MXMLComment">--&gt;</span>
        <span class="MXMLComment">&lt;!--</span><span class="MXMLComment">http://localhost/flexupload/UploadWebService.asmx</span><span class="MXMLComment">--&gt;</span>
        <span class="MXMLComment">&lt;!--</span><span class="MXMLComment">http://localhost:9070/UploadFileWebService/UploadService.asmx</span><span class="MXMLComment">--&gt;</span>
        <span class="MXMLComponent_Tag">&lt;s:WebService</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">service</span><span class="MXMLDefault_Text">" wsdl="</span><span class="MXMLString">http://localhost:9070/UploadFileWebService/UploadService.asmx?wsdl</span><span class="MXMLDefault_Text">" useProxy="</span><span class="MXMLString">false</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;s:operation</span><span class="MXMLDefault_Text"> name="</span><span class="MXMLString">ReadHistoryUpload</span><span class="MXMLDefault_Text">" result="</span><span class="ActionScriptDefault_Text">LoadHistoryTemp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" </span><span class="MXMLComponent_Tag">&gt;</span>                
            <span class="MXMLComponent_Tag">&lt;/s:operation&gt;</span>
            <span class="MXMLComponent_Tag">&lt;s:operation</span><span class="MXMLDefault_Text"> name="</span><span class="MXMLString">WriteFile</span><span class="MXMLDefault_Text">" result="</span><span class="ActionScriptDefault_Text">onResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" fault="</span><span class="ActionScriptDefault_Text">onFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>                
            <span class="MXMLComponent_Tag">&lt;/s:operation&gt;</span>
            <span class="MXMLComponent_Tag">&lt;s:operation</span><span class="MXMLDefault_Text"> name="</span><span class="MXMLString">CheckFile</span><span class="MXMLDefault_Text">" result="</span><span class="ActionScriptDefault_Text">onCheckResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" fault="</span><span class="ActionScriptDefault_Text">onCheckFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>                
            <span class="MXMLComponent_Tag">&lt;/s:operation&gt;</span>            
            <span class="MXMLComponent_Tag">&lt;s:operation</span><span class="MXMLDefault_Text"> name="</span><span class="MXMLString">CopyFile</span><span class="MXMLDefault_Text">" result="</span><span class="ActionScriptDefault_Text">onCopyResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" fault="</span><span class="ActionScriptDefault_Text">onCopyFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>                
            <span class="MXMLComponent_Tag">&lt;/s:operation&gt;</span>
            <span class="MXMLComponent_Tag">&lt;s:operation</span><span class="MXMLDefault_Text"> name="</span><span class="MXMLString">DeleteFile</span><span class="MXMLDefault_Text">" result="</span><span class="ActionScriptDefault_Text">onDeleteResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">" fault="</span><span class="ActionScriptDefault_Text">onDeleteFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>                
            <span class="MXMLComponent_Tag">&lt;/s:operation&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/s:WebService&gt;</span>
    <span class="MXMLSpecial_Tag">&lt;/fx:Declarations&gt;</span>
    <span class="MXMLSpecial_Tag">&lt;fx:Script&gt;</span>
        &lt;![CDATA[
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">external</span><span class="ActionScriptOperator">.</span><span class="ActionScriptOperator">*</span>;
            
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flashx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">textLayout</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">formats</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Float</span>;
            
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">controls</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">Alert</span>;
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">FlexEvent</span>;
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ListEvent</span>;
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">messaging</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">channels</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">StreamingAMFChannel</span>;
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rpc</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">FaultEvent</span>;
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rpc</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ResultEvent</span>;
            
            <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">org</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">osmf</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">layout</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">AbsoluteLayoutFacet</span>;
            
            <span class="ActionScriptComment">//----------------上传中使用的临时数据容器-------------------
</span>            <span class="ActionScriptComment">//声明文件引用
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">fileRefer</span>:<span class="ActionScriptDefault_Text">FileReference</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">null</span>;    
            <span class="ActionScriptComment">//需要上传的文件数组
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">fileArray</span>:<span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">null</span>;
            <span class="ActionScriptComment">//每次要传递的数组
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">fileUpload</span>:<span class="ActionScriptDefault_Text">ByteArray</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">null</span>;
            
            <span class="ActionScriptComment">//当前传递的文件索引号
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">curFileIndex</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span>0 ;            
            <span class="ActionScriptComment">//一次最大上传文件数
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">ALLOW_MAX</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">=</span>5;            
            <span class="ActionScriptComment">//每次传递块的大小 100K
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">BLOCKSIZE</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 1024<span class="ActionScriptOperator">*</span>100;
            <span class="ActionScriptComment">//格式化数据大小
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptReserved">static</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">EXCEPTSIZE</span>:<span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptOperator">=</span>1024;
            
            <span class="ActionScriptComment">//----------计算进度条------------------
</span>            <span class="ActionScriptComment">//总共上传文件的大小
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">TotalSize</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">=</span>0;
            <span class="ActionScriptComment">//当前已上传文件的大小
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">CurSize</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">=</span>0;
            <span class="ActionScriptComment">//总进度条宽度
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptReserved">static</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">TOTAL_PROCESS_WIDTH</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 507;
            <span class="ActionScriptComment">//子进度条宽度
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptReserved">static</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">SUB_PROCESS_WIDTH</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 145;
            
            
            <span class="ActionScriptComment">//是否挂起
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">IsSuspend</span>:<span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptComment">//是否完成
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">IsFinish</span>:<span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            
            <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">func_example</span>:<span class="ActionScriptDefault_Text">Function</span>; <span class="ActionScriptComment">//回调函数，具体函数在主mxml里设置。
</span>            
            <span class="ActionScriptComment">//页面加载完毕，进行相关事件注册
</span>            <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">initizeApp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">FlexEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">//初始化文件浏览事件
</span>                <span class="ActionScriptDefault_Text">btnBrower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">CLICK</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">btnBrower_clickHandler</span><span class="ActionScriptBracket/Brace">)</span>;<span class="ActionScriptComment">//浏览文件事件
</span>                <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">CLICK</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">btnUpload_clickHandler</span><span class="ActionScriptBracket/Brace">)</span>;<span class="ActionScriptComment">//上传文件事件
</span>                <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">CLICK</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">btnSuspend_clickHandler</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">mx</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">events</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ListEvent</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ITEM_CLICK</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">process_list_itemClickHandler</span><span class="ActionScriptBracket/Brace">)</span>;
                
                <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
                <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"暂停"</span>;
                
                
                <span class="ActionScriptDefault_Text">fileArray</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">fileUpload</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ByteArray</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                
                
                <span class="ActionScriptComment">//加载历史遗留的上传记录
</span>                <span class="ActionScriptDefault_Text">service</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">ReadHistoryUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">""</span><span class="ActionScriptBracket/Brace">)</span>;
                
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptComment">/*
             * 加载历史遗漏的上传记录
            */</span>
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">LoadHistoryTemp</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">evt</span>:<span class="ActionScriptDefault_Text">ResultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">evt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">result</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">==</span><span class="ActionScriptString">""</span><span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptReserved">return</span>;
                
                <span class="ActionScriptComment">//获取返回值
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">BackListArr</span>:<span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">BackListArr</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">evt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">result</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">split</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">";"</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">BackListArr</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">pop</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                
                <span class="ActionScriptComment">//申明一个数组绑定控件
</span>                <span class="ActionScriptDefault_Text">fileArray</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">intIndex</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 0;
                
                <span class="ActionScriptReserved">for each</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">curList</span>:<span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptReserved">in</span> <span class="ActionScriptDefault_Text">BackListArr</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptComment">//获取服务器的返回字符串
</span>                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">curArr</span>:<span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                    <span class="ActionScriptDefault_Text">curArr</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">BackListArr</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">split</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">","</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">filesize</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">curArr</span><span class="ActionScriptBracket/Brace">[</span>1<span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">cursize</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">curArr</span><span class="ActionScriptBracket/Brace">[</span>2<span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                    <span class="ActionScriptComment">//push数组
</span>                    <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span> 
                        <span class="ActionScriptBracket/Brace">{</span>
                            <span class="ActionScriptDefault_Text">label</span>: <span class="ActionScriptDefault_Text">curArr</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span> <span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">data</span>: <span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">filesize</span><span class="ActionScriptOperator">/</span><span class="ActionScriptDefault_Text">EXCEPTSIZE</span> <span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toFixed</span><span class="ActionScriptBracket/Brace">(</span>4<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">"KB"</span><span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">size</span>:  <span class="ActionScriptDefault_Text">filesize</span><span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">width</span>: <span class="ActionScriptDefault_Text">cursize</span><span class="ActionScriptOperator">/</span><span class="ActionScriptDefault_Text">filesize</span> <span class="ActionScriptOperator">*</span> <span class="ActionScriptDefault_Text">SUB_PROCESS_WIDTH</span> <span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">meta</span>: <span class="ActionScriptReserved">null</span>
                        <span class="ActionScriptBracket/Brace">}</span>
                    <span class="ActionScriptBracket/Brace">)</span>;
                    
                    <span class="ActionScriptDefault_Text">intIndex</span> <span class="ActionScriptOperator">+=</span> 1;
                <span class="ActionScriptBracket/Brace">}</span>
                                
                <span class="ActionScriptComment">//绑定数据
</span>                <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">dataProvider</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span>;
                
                
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">intIndex</span> <span class="ActionScriptOperator">&gt;</span> 0<span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">"续传"</span>;
                    <span class="ActionScriptDefault_Text">btnBrower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
                    <span class="ActionScriptDefault_Text">IsSuspend</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>            
            <span class="ActionScriptComment">/*
            *挂起 
            *续传
            */</span>
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">btnSuspend_clickHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">evt</span>:<span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">//挂起
</span>                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">IsSuspend</span> <span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">"续传"</span>;
                    <span class="ActionScriptDefault_Text">btnBrower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">IsSuspend</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
                    <span class="ActionScriptReserved">return</span>;                    
                <span class="ActionScriptBracket/Brace">}</span>    
                <span class="ActionScriptComment">//暂停后续传
</span>                <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">IsSuspend</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span><span class="ActionScriptOperator">&gt;</span>0 <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">meta</span><span class="ActionScriptOperator">!=</span><span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptComment">//重置参数
</span>                    <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
                    <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">"暂停"</span>;
                    <span class="ActionScriptDefault_Text">btnBrower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">IsSuspend</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
                    
                    
                    <span class="ActionScriptDefault_Text">curFileIndex</span> <span class="ActionScriptOperator">=</span> 0;
                                        
                    <span class="ActionScriptComment">//验证文件
</span>                    <span class="ActionScriptDefault_Text">CheckFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptComment">//重新加载后续传
</span>                <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptComment">//定义一个新的FileReference                
</span>                    <span class="ActionScriptDefault_Text">fileRefer</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">FileReference</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">filename</span>:<span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span>;
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">filesize</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span>;
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">extenions</span>:<span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">"*"</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">substring</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">lastIndexOf</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"."</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">filename2</span>:<span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">substring</span><span class="ActionScriptBracket/Brace">(</span>0 <span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">lastIndexOf</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"."</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                    
                    <span class="ActionScriptDefault_Text">fileRefer</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">browse</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">FileFilter</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">filename2</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptDefault_Text">fileRefer</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SELECT</span> <span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">onSelect2</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                    <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onSelect2</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">evt</span>:<span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">fileNum</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span>;
                        <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileNum</span> <span class="ActionScriptOperator">&gt;</span> <span class="ActionScriptDefault_Text">ALLOW_MAX</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">{</span>
                            <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"每次只能上传5个文件"</span><span class="ActionScriptBracket/Brace">)</span>;
                            <span class="ActionScriptReserved">return</span>;
                        <span class="ActionScriptBracket/Brace">}</span>
                        
                        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">filename</span>:<span class="ActionScriptDefault_Text">FileReference</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileRefer</span>;
                        <span class="ActionScriptComment">//如果文件名合法
</span>                        <span class="ActionScriptComment">//如果文件不在已有队列中    
</span>                        <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">indexOf</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"."</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptOperator">-</span>1 <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">indexOf</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">,</span> 0<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">==</span> <span class="ActionScriptOperator">-</span>1<span class="ActionScriptBracket/Brace">)</span>
                        <span class="ActionScriptBracket/Brace">{</span>
                            <span class="ActionScriptComment">//侦听数据是否load成功
</span>                            <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">COMPLETE</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">onCompleteLoaded</span><span class="ActionScriptBracket/Brace">)</span>;
                            <span class="ActionScriptComment">//load数据
</span>                            <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">load</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                            
                            <span class="ActionScriptDefault_Text">TotalSize</span> <span class="ActionScriptOperator">+=</span> <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span>;
                        <span class="ActionScriptBracket/Brace">}</span>
                        <span class="ActionScriptReserved">else</span><span class="ActionScriptBracket/Brace">{</span>
                            <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"error!"</span><span class="ActionScriptBracket/Brace">)</span>;
                        <span class="ActionScriptBracket/Brace">}</span>                
                        
                        
                        <span class="ActionScriptComment">//加载完毕事件
</span>                        <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onCompleteLoaded</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span>:<span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
                            
                            <span class="ActionScriptComment">//push数组
</span>                            <span class="ActionScriptReserved">for</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">=</span>0; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">&lt;</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span>; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">++</span><span class="ActionScriptBracket/Brace">)</span>
                            <span class="ActionScriptBracket/Brace">{</span>
                                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptBracket/Brace">)</span>
                                <span class="ActionScriptBracket/Brace">{</span>
                                    <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">meta</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">data</span>;
                                <span class="ActionScriptBracket/Brace">}</span>
                            <span class="ActionScriptBracket/Brace">}</span>
                            
                            <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"续传文件加载完毕,现在可以上传文件了"</span>;
                            <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;                            
                            <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">"暂停"</span>;
                            <span class="ActionScriptDefault_Text">IsSuspend</span>  <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
                            
                            
                            <span class="ActionScriptComment">//重置参数
</span>                            <span class="ActionScriptDefault_Text">curFileIndex</span> <span class="ActionScriptOperator">=</span> 0;
                            
                            
                            <span class="ActionScriptComment">//验证文件
</span>                            <span class="ActionScriptDefault_Text">CheckFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                            
                        <span class="ActionScriptBracket/Brace">}</span>
                    <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>            
            <span class="ActionScriptComment">//浏览按钮事件
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">btnBrower_clickHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">mevent</span>:<span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">//如果完成队列  在上传就需要清空队列
</span>                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">IsFinish</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptReserved">while</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span><span class="ActionScriptOperator">&gt;</span>0<span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">pop</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptBracket/Brace">}</span>
                    <span class="ActionScriptDefault_Text">IsFinish</span>  <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">dataProvider</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
                <span class="ActionScriptComment">//重新申明一个对象
</span>                <span class="ActionScriptDefault_Text">fileRefer</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">FileReference</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptComment">//浏览
</span>                <span class="ActionScriptDefault_Text">fileRefer</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">browse</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptComment">//侦听文件选择事件
</span>                <span class="ActionScriptDefault_Text">fileRefer</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">SELECT</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">onSelect</span><span class="ActionScriptBracket/Brace">)</span>;
                                
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptComment">//浏览文件
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onSelect</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">evt</span>:<span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>                
                <span class="ActionScriptComment">//判断是否加载完成
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">fileNumComplete</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 0;
                
                <span class="ActionScriptComment">//判断当前上传文件队列是否大于上传限制                
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">fileNum</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span>;
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileNum</span> <span class="ActionScriptOperator">&gt;</span> <span class="ActionScriptDefault_Text">ALLOW_MAX</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"每次只能上传5个文件"</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptReserved">return</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">filename</span>:<span class="ActionScriptDefault_Text">FileReference</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileRefer</span>;
                <span class="ActionScriptComment">//如果文件名合法
</span>                <span class="ActionScriptComment">//如果文件不在已有队列中                    
</span>                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">indexOf</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"."</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptOperator">-</span>1 <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">IsExists</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptComment">//侦听数据是否load成功
</span>                    <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">COMPLETE</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">onCompleteLoaded</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptComment">//load数据
</span>                    <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">load</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptComment">//获取总大小
</span>                    <span class="ActionScriptDefault_Text">TotalSize</span> <span class="ActionScriptOperator">+=</span> <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptReserved">else</span><span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"error!"</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptBracket/Brace">}</span>                
                
                
                <span class="ActionScriptComment">//加载完毕事件
</span>                <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onCompleteLoaded</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span>:<span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
                    
                    <span class="ActionScriptComment">//push数组
</span>                    <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">push</span><span class="ActionScriptBracket/Brace">(</span> 
                        <span class="ActionScriptBracket/Brace">{</span>
                            <span class="ActionScriptDefault_Text">label</span>:<span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">data</span>:<span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span><span class="ActionScriptOperator">/</span><span class="ActionScriptDefault_Text">EXCEPTSIZE</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toFixed</span><span class="ActionScriptBracket/Brace">(</span>4<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">"KB"</span><span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">size</span>: <span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span><span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">width</span>:0 <span class="ActionScriptOperator">,</span>
                            <span class="ActionScriptDefault_Text">meta</span>:<span class="ActionScriptDefault_Text">filename</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">data</span>
                        <span class="ActionScriptBracket/Brace">}</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                    <span class="ActionScriptComment">//绑定数据
</span>                    <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">dataProvider</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span>;
                    
                    <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"文件加载完毕,现在可以上传文件了"</span>;
                    <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
                <span class="ActionScriptComment">//判断当前队列中是否存在此文件
</span>                <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">IsExists</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span>:<span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptReserved">for each</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">curItem</span>:<span class="ActionScriptDefault_Text">Object</span> <span class="ActionScriptReserved">in</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">curItem</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptOperator">==</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptBracket/Brace">)</span>
                            <span class="ActionScriptReserved">return</span> <span class="ActionScriptReserved">true</span>;
                    <span class="ActionScriptBracket/Brace">}</span>
                    <span class="ActionScriptReserved">return</span> <span class="ActionScriptReserved">false</span>;
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptComment">//上传按钮事件
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">btnUpload_clickHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">//重置参数
</span>                <span class="ActionScriptDefault_Text">curFileIndex</span> <span class="ActionScriptOperator">=</span> 0;
                                
                <span class="ActionScriptComment">//验证文件
</span>                <span class="ActionScriptDefault_Text">CheckFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptComment">//校验文件函数
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">CheckFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>                
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span><span class="ActionScriptOperator">-</span>1 <span class="ActionScriptOperator">&lt;</span><span class="ActionScriptDefault_Text">curFileIndex</span> <span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptReserved">return</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">btnBrower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
                    <span class="ActionScriptComment">//调用webservice方法，传递文件名进行校验                    
</span>                    <span class="ActionScriptDefault_Text">service</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">CheckFile</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptBracket/Brace">)</span>;    
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>    
            <span class="ActionScriptComment">/*
            *webervice,校验成功
            */</span>
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onCheckResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">ResultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">//获取返回值
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">retArray</span>:<span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Array</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">retArray</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">result</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">split</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">","</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptComment">//返回文件存在与否消息
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">retMsg</span>:<span class="ActionScriptDefault_Text">String</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">retArray</span><span class="ActionScriptBracket/Brace">[</span>0<span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptComment">//返回文件大小
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">retNum</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">retArray</span><span class="ActionScriptBracket/Brace">[</span>1<span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;        
                <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">retMsg</span>;
                
                <span class="ActionScriptComment">//断点续传需要重新计算块数，剩余大小
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">Leave</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span><span class="ActionScriptOperator">-</span><span class="ActionScriptDefault_Text">retNum</span>;
                
                
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span>0 <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Leave</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"文件已上传完毕"</span>;
                    <span class="ActionScriptReserved">return</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
                
                <span class="ActionScriptComment">//如果没有上传 或者  还未传完 继续上传
</span>                <span class="ActionScriptComment">//判断剩余情况，如果剩下的大于每次发送的块，继续按快上传
</span>                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Leave</span><span class="ActionScriptOperator">&gt;=</span><span class="ActionScriptDefault_Text">BLOCKSIZE</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>                
                    <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"正在处理..."</span>;
                    <span class="ActionScriptComment">//调用上传函数
</span>                    <span class="ActionScriptDefault_Text">uploadFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">retNum</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">BLOCKSIZE</span><span class="ActionScriptBracket/Brace">)</span>;                            
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptComment">//如果剩下的小于每次发送的块，则上传剩余块
</span>                <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptComment">//直接从返回值大小开始，传递剩余部分
</span>                    <span class="ActionScriptDefault_Text">uploadFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">retNum</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">Leave</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptBracket/Brace">}</span>                
                            
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptComment">/*
            * webservice相关事件函数，上传成功
            */</span>
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">ResultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">//暂停
</span>                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">IsSuspend</span> <span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptReserved">return</span>;                    
                <span class="ActionScriptBracket/Brace">}</span>
                                
                <span class="ActionScriptComment">//每次上传成功返回值，作为下次传递的开始位置
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">begin</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">result</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptComment">//判断剩余块多少
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">reBlock</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span> <span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">begin</span>;
                <span class="ActionScriptComment">//进度条
</span>                <span class="ActionScriptDefault_Text">onProgress</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">begin</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span><span class="ActionScriptBracket/Brace">)</span>;
                
                
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">reBlock</span> <span class="ActionScriptOperator">&gt;</span> 0<span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>                
                    <span class="ActionScriptComment">//判断剩余多少，进行不同情况的上传
</span>                    <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">reBlock</span><span class="ActionScriptOperator">&gt;=</span> <span class="ActionScriptDefault_Text">BLOCKSIZE</span><span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptDefault_Text">uploadFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">begin</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">BLOCKSIZE</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptBracket/Brace">}</span>
                    <span class="ActionScriptReserved">else</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptDefault_Text">uploadFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">begin</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">reBlock</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">reBlock</span> <span class="ActionScriptOperator">==</span> 0<span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"上传完毕！"</span>;
                    <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"开始扫描文件..."</span>;
                    <span class="ActionScriptComment">//拷贝文件
</span>                    <span class="ActionScriptDefault_Text">service</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">CopyFile</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptBracket/Brace">)</span>;
                    
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptBracket/Brace">{</span>                
                    <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"上传文件失败,原因：续传中读取块不合法！"</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"上传文件失败"</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptComment">//上传附件函数
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">uploadFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">begin</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">end</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">//判断文件大小
</span>                 <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span> <span class="ActionScriptOperator">&gt;</span> <span class="ActionScriptDefault_Text">begin</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptOperator">,</span><span class="ActionScriptString">"subprocess"</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">begin</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">end</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span>  <span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptComment">//清空缓冲区
</span>                    <span class="ActionScriptDefault_Text">fileUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">clear</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptComment">//分块上传
</span>                    <span class="ActionScriptDefault_Text">fileUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">writeBytes</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">meta</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">begin</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">end</span><span class="ActionScriptBracket/Brace">)</span>;                    
                    <span class="ActionScriptComment">//传送
</span>                    <span class="ActionScriptDefault_Text">service</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">WriteFile</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">size</span><span class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">fileUpload</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptBracket/Brace">}</span>                                            
            <span class="ActionScriptBracket/Brace">}</span>
                
            <span class="ActionScriptComment">//上传失败
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">FaultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>            
            <span class="ActionScriptComment">/*
            *上传进度条
            */</span>
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onProgress</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Loaded</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">Total</span>:<span class="ActionScriptDefault_Text">int</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">proc</span>:<span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">Loaded</span><span class="ActionScriptOperator">/</span><span class="ActionScriptDefault_Text">Total</span>;
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">num</span>:<span class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">curFileIndex</span>;                
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">indexToItemRenderer</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">num</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">!=</span><span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">indexToItemRenderer</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">num</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">document</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">processBar</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">width</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">proc</span><span class="ActionScriptOperator">*</span><span class="ActionScriptDefault_Text">SUB_PROCESS_WIDTH</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toFixed</span><span class="ActionScriptBracket/Brace">(</span>0<span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Loaded</span><span class="ActionScriptOperator">==</span><span class="ActionScriptDefault_Text">Total</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">CurSize</span> <span class="ActionScriptOperator">+=</span> <span class="ActionScriptDefault_Text">Total</span>;
                    <span class="ActionScriptDefault_Text">processBar_Total</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">width</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">CurSize</span><span class="ActionScriptOperator">/</span><span class="ActionScriptDefault_Text">TotalSize</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">*</span><span class="ActionScriptDefault_Text">TOTAL_PROCESS_WIDTH</span>;            
                    <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"已上传:"</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">CurSize</span><span class="ActionScriptOperator">/</span><span class="ActionScriptDefault_Text">EXCEPTSIZE</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toFixed</span><span class="ActionScriptBracket/Brace">(</span>4<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">'KB/'</span><span class="ActionScriptOperator">+</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">TotalSize</span><span class="ActionScriptOperator">/</span><span class="ActionScriptDefault_Text">EXCEPTSIZE</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toFixed</span><span class="ActionScriptBracket/Brace">(</span>4<span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">+</span><span class="ActionScriptString">"KB"</span>;
                <span class="ActionScriptBracket/Brace">}</span>
                
                <span class="ActionScriptComment">//trace( curFileIndex,"subprocess",Loaded,Total,(proc*SUB_PROCESS_WIDTH).toFixed(0),"---total:",CurSize,TotalSize, ((CurSize/TotalSize)*TOTAL_PROCESS_WIDTH).toFixed(0) );
</span>                
            <span class="ActionScriptBracket/Brace">}</span>            
            <span class="ActionScriptComment">//复制文件
</span>            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onCopyResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">ResultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                
                <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"完成上传:"</span> <span class="ActionScriptOperator">+</span>  <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span> ;
                
                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">curFileIndex</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span> <span class="ActionScriptOperator">-</span> 1<span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptDefault_Text">CurSize</span> <span class="ActionScriptOperator">=</span>0;
                    <span class="ActionScriptDefault_Text">TotalSize</span> <span class="ActionScriptOperator">=</span>0;
                    <span class="ActionScriptDefault_Text">IsFinish</span> <span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;
                    <span class="ActionScriptDefault_Text">btnBrower</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">true</span>;                    
                    <span class="ActionScriptDefault_Text">btnUpload</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    <span class="ActionScriptDefault_Text">btnSuspend</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">enabled</span><span class="ActionScriptOperator">=</span><span class="ActionScriptReserved">false</span>;
                    
                    <span class="ActionScriptDefault_Text">tip_txt</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">"完成"</span>;                    
                                        
                <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptReserved">else</span>
                <span class="ActionScriptBracket/Brace">{</span>
                    <span class="ActionScriptComment">//当前索引增1
</span>                    <span class="ActionScriptDefault_Text">curFileIndex</span> <span class="ActionScriptOperator">+=</span> 1;                    
                    
                    <span class="ActionScriptComment">//如果队列中上传文件，继续上传
</span>                    <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">length</span><span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptComment">//移动到当前上传节点
</span>                        <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">scrollToIndex</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">)</span>;                        
                        
                        <span class="ActionScriptComment">//验证文件 上传
</span>                        <span class="ActionScriptDefault_Text">CheckFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>;
                    <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>            
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onCopyFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">FaultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>                    
            
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onCheckFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">FaultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onDeleteResult</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">ResultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"删除成功！"</span><span class="ActionScriptBracket/Brace">)</span>;                
            <span class="ActionScriptBracket/Brace">}</span>                    
            
            <span class="ActionScriptReserved">internal</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">onDeleteFault</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">FaultEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">"删除失败！"</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">toString</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">process_list_itemClickHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>:<span class="ActionScriptDefault_Text">ListEvent</span><span class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptReserved">void</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptComment">// TODO Auto-generated method stub
</span>                <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span> <span class="ActionScriptOperator">,</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rowIndex</span><span class="ActionScriptBracket/Brace">)</span>;                
                <span class="ActionScripttrace">trace</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">indexToItemRenderer</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rowIndex</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">document</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">btnDel</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selected</span><span class="ActionScriptBracket/Brace">)</span>;
                
                <span class="ActionScriptComment">//需要删除的行索引
</span>                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">delIndex</span>:<span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rowIndex</span>;
                
                <span class="ActionScriptComment">//是否点击删除按钮
</span>                <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">indexToItemRenderer</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">rowIndex</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">document</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">btnDel</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">selected</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptBracket/Brace">{</span>                                                
                    <span class="ActionScriptComment">//如果删除的项目是当前正在上传的项目
</span>                    <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">delIndex</span> <span class="ActionScriptOperator">&lt;=</span> <span class="ActionScriptDefault_Text">curFileIndex</span><span class="ActionScriptBracket/Brace">)</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptComment">//通知服务器，删除已上传的临时文件
</span>                        <span class="ActionScriptDefault_Text">service</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">DeleteFile</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">send</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">delIndex</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">label</span><span class="ActionScriptBracket/Brace">)</span>;    
                        
                        <span class="ActionScriptComment">//删除数据
</span>                        <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">splice</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">delIndex</span><span class="ActionScriptOperator">,</span>1<span class="ActionScriptBracket/Brace">)</span>;
                        <span class="ActionScriptComment">//绑定数据
</span>                        <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">dataProvider</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span>;
                        
                        <span class="ActionScriptComment">//当前索引加1
</span>                        <span class="ActionScriptDefault_Text">curFileIndex</span> <span class="ActionScriptOperator">-=</span> 1;                            
                    <span class="ActionScriptBracket/Brace">}</span>
                    <span class="ActionScriptReserved">else</span>
                    <span class="ActionScriptBracket/Brace">{</span>
                        <span class="ActionScriptComment">//删除数据
</span>                        <span class="ActionScriptDefault_Text">fileArray</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">splice</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">delIndex</span><span class="ActionScriptOperator">,</span>1<span class="ActionScriptBracket/Brace">)</span>;
                        <span class="ActionScriptComment">//绑定数据
</span>                        <span class="ActionScriptDefault_Text">process_list</span><span class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">dataProvider</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">fileArray</span>;
                    <span class="ActionScriptBracket/Brace">}</span>
                <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptBracket/Brace">]</span><span class="ActionScriptOperator">&gt;</span>
    <span class="MXMLSpecial_Tag">&lt;/fx:Script&gt;</span>
    <span class="MXMLComponent_Tag">&lt;s:Group</span><span class="MXMLDefault_Text">  width="</span><span class="MXMLString">100%</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">356</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>
        <span class="MXMLComponent_Tag">&lt;s:Button</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">btnBrower</span><span class="MXMLDefault_Text">" x="</span><span class="MXMLString">322</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">25</span><span class="MXMLDefault_Text">" label="</span><span class="MXMLString">浏览...</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">60</span><span class="MXMLDefault_Text">" </span><span class="MXMLComponent_Tag">&gt;</span><span class="MXMLComponent_Tag">&lt;/s:Button&gt;</span>
        <span class="MXMLComponent_Tag">&lt;s:TextInput</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">edFile</span><span class="MXMLDefault_Text">" x="</span><span class="MXMLString">21</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">24</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">297</span><span class="MXMLDefault_Text">" enabled="</span><span class="MXMLString">false</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;s:Button</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">btnUpload</span><span class="MXMLDefault_Text">" x="</span><span class="MXMLString">397</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">25</span><span class="MXMLDefault_Text">" label="</span><span class="MXMLString">开始上传</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">71</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Canvas</span><span class="MXMLDefault_Text"> width="</span><span class="MXMLString">531</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">25</span><span class="MXMLDefault_Text">" backgroundColor="</span><span class="MXMLString">0Xf1f1f1</span><span class="MXMLDefault_Text">" x="</span><span class="MXMLString">21</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">295</span><span class="MXMLDefault_Text">" borderStyle="</span><span class="MXMLString">solid</span><span class="MXMLDefault_Text">" borderColor="</span><span class="MXMLString">0Xbbbbbb</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> text="</span><span class="MXMLDefault_Text">" fontWeight="</span><span class="MXMLString">bold</span><span class="MXMLDefault_Text">" id="</span><span class="MXMLString">tip_txt</span><span class="MXMLDefault_Text">" x="</span><span class="MXMLString">5</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">4</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/&gt;</span>            
        <span class="MXMLComponent_Tag">&lt;/mx:Canvas&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:List</span><span class="MXMLDefault_Text"> x="</span><span class="MXMLString">21</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">54</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">530</span><span class="MXMLDefault_Text">" rowCount="</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">" allowMultipleSelection="</span><span class="MXMLString">true</span><span class="MXMLDefault_Text">" borderStyle="</span><span class="MXMLString">solid</span><span class="MXMLDefault_Text">" borderColor="</span><span class="MXMLString">0Xbbbbbb</span><span class="MXMLDefault_Text">" 
                 rowHeight="</span><span class="MXMLString">25</span><span class="MXMLDefault_Text">" id="</span><span class="MXMLString">process_list</span><span class="MXMLDefault_Text">" itemRenderer="</span><span class="MXMLString">ImageItem</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">233</span><span class="MXMLDefault_Text">" </span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Canvas</span><span class="MXMLDefault_Text"> id="</span><span class="MXMLString">totalProcess</span><span class="MXMLDefault_Text">" borderStyle="</span><span class="MXMLString">solid</span><span class="MXMLDefault_Text">" x="</span><span class="MXMLString">22</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">507</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">329</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">13</span><span class="MXMLDefault_Text">" borderColor="</span><span class="MXMLString">0X124fc0</span><span class="MXMLDefault_Text">" backgroundColor="</span><span class="MXMLString">0xffffff</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">&gt;</span>
            <span class="MXMLComponent_Tag">&lt;mx:Canvas</span><span class="MXMLDefault_Text"> backgroundColor="</span><span class="MXMLString">0X124fc0</span><span class="MXMLDefault_Text">" backgroundAlpha="</span><span class="MXMLString">0.5</span><span class="MXMLDefault_Text">" id="</span><span class="MXMLString">processBar_Total</span><span class="MXMLDefault_Text">" width="</span><span class="MXMLString">0</span><span class="MXMLDefault_Text">" height="</span><span class="MXMLString">23</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;/mx:Canvas&gt;</span>
        <span class="MXMLComponent_Tag">&lt;s:Button</span><span class="MXMLDefault_Text"> x="</span><span class="MXMLString">481</span><span class="MXMLDefault_Text">" y="</span><span class="MXMLString">25</span><span class="MXMLDefault_Text">" label="</span><span class="MXMLString">暂停</span><span class="MXMLDefault_Text">" id="</span><span class="MXMLString">btnSuspend</span><span class="MXMLDefault_Text">"</span><span class="MXMLComponent_Tag">/&gt;</span>
        
    <span class="MXMLComponent_Tag">&lt;/s:Group&gt;</span>
<span class="MXMLComponent_Tag">&lt;/s:Application&gt;</span></pre></body>
</html>
